package com.example.myapplication.window;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;

import com.example.myapplication.R;
import com.example.myapplication.activity.PubGetAty;
import com.example.myapplication.activity.PubSellAty;
import com.example.myapplication.event.PhotoResultEvent;
import com.example.myapplication.util.ActivityStack;
import com.example.myapplication.util.easyphoto.GlideEngine;
import com.huantansheng.easyphotos.EasyPhotos;
import com.huantansheng.easyphotos.callback.SelectCallback;
import com.huantansheng.easyphotos.models.album.entity.Photo;

import org.greenrobot.eventbus.EventBus;

import java.util.ArrayList;

public class ChoosePubPop extends PopupWindow {
    private Context context;
    public ChoosePubPop(Context context){
        super(context);
        this.context=context;
        init();
    }

    private void init() {
        View inflate = LayoutInflater.from(context).inflate(R.layout.pop_choose_pub, null);
        setContentView(inflate);
        int width = ((Activity) context).getWindowManager().getDefaultDisplay().getWidth();
        int height = ((Activity) context).getWindowManager().getDefaultDisplay().getHeight();
        setWidth(width);
        setHeight(height);
        inflate.findViewById(R.id.btPubSell).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.startActivity(new Intent(context,PubSellAty.class));

                dismiss();
            }
        });
        inflate.findViewById(R.id.btPubGet).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.startActivity(new Intent(context, PubGetAty.class));

                dismiss();

            }
        });

        inflate.findViewById(R.id.btPubPlay).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();

            }
        });

        inflate.findViewById(R.id.btCancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}
